

$(function(){

	requestData("json/dataAnalsis.json", function(data) {
        require.config({
            paths: {
                echarts: 'js/echarts'
            }
        });
        require(
            [
                'echarts',
                'echarts/chart/bar'
            ],
            function (ec) {
                var myChart = ec.init(document.getElementById('bar'));
                var placeHoledStyle = {
                    normal:{
                        barBorderColor:'rgba(0,0,0,0)',
                        color:'rgba(0,0,0,0)'
                    },
                    emphasis:{
                        barBorderColor:'rgba(0,0,0,0)',
                        color:'rgba(0,0,0,0)'
                    }
                };
                var dataStyle = {
                    normal: {
                        label : {
                            show: true,
                            position: 'insideLeft',
                            formatter: '{c}%'
                        }
                    }
                };
                var option = {
                    title: {
                        text: 'Semantic Association Analysis',
                        subtext: '',
                        sublink: ''
                    },
                    tooltip : {
                        trigger: 'axis',
                        axisPointer : {
                            type : 'shadow'
                        },
                        formatter : '{c0}%'
                    },
                    grid: {
                        y: 80,
                        y2: 30
                    },
                    xAxis : [
                        {
                            type : 'value',
                            position: 'top',
                            splitLine: {show: false},
                            axisLabel: {show: false}
                        }
                    ],
                    yAxis : [
                        {
                            type : 'category',
                            splitLine: {show: false},
                            data : data.bar.names
                        }
                    ],
                    series : [
                        {
                            name:'',
                            type:'bar',
                            stack: '',
                            itemStyle : dataStyle,
                            data:data.bar.datas
                        }
                    ]
                };
                myChart.setOption(option);
            }
        );
    },'json');
});